package cn.edu.scau.cmi.yangzhengkai.composite.consistent;

import java.util.Set;

public class ConsistentComposite  extends ConsistentComponent{
	
	private String name;

	public String doSomething() {
		System.out.println("this is consisentComponent");

		return null;
	}
	
	public ConsistentComposite() {
		
	}
	
	public ConsistentComposite(String name) {
		this.name = name;
	}
	
	public ConsistentComposite(String name, ConsistentComponent parent) {
		this(name);
		this.parent = parent;
	}

	public ConsistentComponent getParent() {
		return parent;
	}

	public Set<ConsistentComponent> getChildren() {
		
		return getChildren();
	}

	public ConsistentComponent addChild(ConsistentComponent child) {
		this.children.add(child);
		return this;
	}

	@Override
	public ConsistentComponent deleteChild(ConsistentComponent child) {
		children.remove(child);
		return this;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
    public String toString() {
		
		return this.name;
	}

}